package com.lt.experiment05.mission02;

/**
 * @author LT
 * @version 1.0
 * @PackageName com.lt.experiment05.mission02
 * @ClassName Test
 * @Description to do
 * @date 2021/11/20 23:59
 */
public class Test {
    public static void main(String[] args) {
        Component computer = new Computer();
        Component jianPan = new JianPan();
        Component xianShiQi = new XianShiQi();
        Component jiXiang = new JiXiang();
        Component shuBiao = new ShuBiao();
        Component zhuBan = new ZhuBan();
        Component yingPan =new YingPan();
        Component dianYuan =new DianYuan();
        Component cpu =new CPU();
        Component neiCun =new NeiCun();
        Component xianKa =new XianKa();
        try {
            jiXiang.add(zhuBan);
            jiXiang.add(yingPan);
            jiXiang.add(dianYuan);
            zhuBan.add(cpu);
            zhuBan.add(neiCun);
            zhuBan.add(xianKa);
            computer.add(jianPan);
            computer.add(xianShiQi);
            computer.add(jiXiang);
            computer.add(shuBiao);
        } catch (Exception e) {
            e.printStackTrace();
        }
        computer.print();
    }
}
